<div class="span3">
    <div class="well sidebar-nav">
        <ul class="nav nav-list">
            <li class="nav-header"><?php echo __('Actions'); ?></li>
            <li><?php echo $this->Html->link(__('New Product'), array('action' => 'add')); ?></li>
            <li><?php echo $this->Html->link(__('List Images'), array('controller' => 'images', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Image'), array('controller' => 'images', 'action' => 'add')); ?> </li>
        </ul>
    </div>
</div>

<div class="span9">
    <?php echo $this->Session->flash(); ?>
    <div class="page-header">
        <h1><?php echo __('Productos'); ?></h1>
    </div>

    <table class="table table-bordered table-striped">
        <thead>
            <th><?php echo $this->Paginator->sort('id'); ?></th>
            <th><?php echo $this->Paginator->sort('title', 'Titulo'); ?></th>
            <th><?php echo $this->Paginator->sort('technical', 'Archivo'); ?></th>
            <th><?php echo $this->Paginator->sort('is_active', 'Activo'); ?></th>
            <th colspan="3"><?php echo __('Actions'); ?></th>
            </tr>
        </thead>
        <tbody>    
    <?php
    foreach ($products as $product): ?>
    <tr>
        <td><?php echo h($product['Product']['id']); ?>&nbsp;</td>
        <td><?php echo h($product['Product']['title']); ?>&nbsp;</td>
        <td>
        <?php if (h($product['Product']['technical'])): ?>        
            <?php $link = $this->Html->url(h($product['Product']['technical']), true ); ?>
            <a href="<?php echo $link ?>" title="descargue el archivo"><?php echo __('archivo') ?></a>
        <?php endif; ?>
        &nbsp;
        </td>
        <td><?php echo (h($product['Product']['is_active']) == 1) ? 'si' : 'no'; ?>&nbsp;</td>
        <td>
            <?php echo $this->Html->link(__('View'), array('action' => 'view', $product['Product']['id']), array('class' => 'btn btn-info')); ?>
        </td>
        <td>
            <?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $product['Product']['id']), array('class' => 'btn btn-warning')); ?>        
        </td>
        <td>
            <?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $product['Product']['id']), array('class' => 'btn btn-danger'), __('Are you sure you want to delete # %s?', $product['Product']['id'])); ?>
        
        </td>
    </tr>

<?php endforeach; ?>    
</tbody>
    </table>
    
     <div class="well">
        <?php echo $this->Paginator->counter(array('format' => __d('cake', 'Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}'))); ?>
    </div>
    <?php if ($this->Paginator->numbers()): ?>
        <div class="pagination">
            <ul>
                <?php echo $this->Paginator->first(); ?>
                <?php echo $this->Paginator->prev(); ?>
                <?php echo $this->Paginator->numbers(); ?>
                <?php echo $this->Paginator->next(); ?>
                <?php echo $this->Paginator->last(); ?>
            </ul>
        </div>
    <?php endif ?>
</div>
